<script>
import Base from "./Base";
export default {
  name: "ChartSimple",
  mixins: [Base],
  data() {
    return {
      defaultOption: {
        series: [
          {
            type: "gauge",
            progress: {
              show: true,
              width: 10,
            },
            axisLine: {
              lineStyle: {
                width: 10,
              },
            },
            axisTick: {
              show: false,
            },
            splitLine: {
              length: 10,
              lineStyle: {
                width: 2,
                color: "#999",
              },
            },
            axisLabel: {
              distance: 16,
              color: "#999",
              fontSize: 14,
            },
            anchor: {
              show: true,
              showAbove: true,
              size: 14,
              itemStyle: {
                borderWidth: 10,
              },
            },
            title: {
              offsetCenter: [0, "100%"], //设置完成率位置
            },
            detail: {
              valueAnimation: true,
              fontSize: 24,
              offsetCenter: [0, "70"],
            },
            data: [],
          },
        ],
      },
    };
  },
  computed: {
    option: function () {
      let series = [];
      const { simpleData } = this.handleData(this.dataset);
      this.defaultOption.series[0].data = simpleData;
      return {
        ...this.defaultOption,
        ...this.dataset.option,
        ...series,
      };
    },
  },
};
</script>
